home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / tcoop.arc / TCOOP2.ARC / GTEST.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1991-10-26  |  1.3 KB  |  48 lines

  1. // gtest.cpp: Tests the Grso, Gfso, and Wso types by displaying 
  2. // two objects and writing to them. Try moving the objects around
  3. // by dragging them by their border"s using the mouse or use the 
  4. // shift arrow keys. Press ALT-X to quit the program. 
  5.  
  6. #include "grphscrn.h"
  7. #include <conio.h>
  8.  
  9. Wso *W1, *W2;
  10. int I, J;
  11. int Gd, Gm;
  12.  
  13. main() 
  14. {
  15.   Rso *Ip;
  16.  
  17.   Gd = DETECT;
  18.   Setup(MouseOptional, Gd, Gm, "\\tcpp\\bgi", SANS_SERIF_FONT);
  19.   FullScrn->Panel->Clear(' ', 0x70);   // Clear the screen using grey
  20.   // Draw a series of boxes on the screen
  21.   Mouse.Hide();
  22.   for (J = 0; J <= getmaxy() / 20; J++) {
  23.      for (I = 0; I <= getmaxx() / 20; I++) {
  24.      FullScrn->Panel->Interior->Box(
  25.        I*20+3, J*20+2, 15, 15, Relief+1, GrphColors.Bc);
  26.      }
  27.   }
  28.   Mouse.Show();
  29.   // Create a window and display a message to it that will be clipped
  30.   W2 = new Wso(0x11, WindowStyle, ErrColors);
  31.   W2->SetSize(200, 80);
  32.   W2->Open(FullScrn, 5, 5);
  33.   W2->Panel->HzWrt(15, 15, "This message is clipped", 0);
  34.   // Display another window and write a circle in it
  35.   W1 = new Wso(Relief+3, WindowStyle-BorderPrompt, GrphColors);
  36.   W1->SetSize(101, 100);
  37.   W1->Open(FullScrn, 210, 70);
  38.   setcolor(0);
  39.   Mouse.Hide();
  40.   Ip = W1->Panel->Interior;
  41.     circle(Ip->Xul+Ip->Wd/2, Ip->Yul+Ip->Ht/2, Ip->Wd/2);
  42.   Mouse.Show();
  43.   MainEventLoop();
  44.   CleanUp();
  45. }
  46.  
  47.  
  48.